<?php
/**
 * 登录框及选区
 */
class loginHtmlView {
	
	static private $zoneCFG='';
	static private $mc='';
	
	static public function loadZoneConfig(){
		if(self::$zoneCFG==''){
			if(function_exists('get_dmz_game_zone')){
				self::$zoneCFG=get_dmz_game_zone();
			}else{
				load_config('lang');
				load_helper('func');
				self::$zoneCFG=get_dmz_game_zone();
			}
		}
		return ;
	}
	
	static public function loadCacheConfig(){
		if(!function_exists('getCacheServer')){
			load_config('commonMain/mc');
			load_library('mc'); //加载cache类
		}
	}
	/**
	 * 大区选择框
	 * Enter description here ...
	 */
	static public function selectZoneFrame($uin){
		if(empty($uin)) return false;
		self::loadZoneConfig();
		
		$selectZone='';
		asort(self::$zoneCFG);
		foreach (self::$zoneCFG as $zoneid=>$zoneName){
			$ret=getGameUserInfoByUin($uin,$zoneid);
			if(!empty($ret)){
				$selectZone.='<a href="" class="selectZoneBtn">'.$zoneName.'<br />'.$ret['Level'].'&nbsp;'.$ret['RoleName'].'</a>';
			}else{
				$selectZone.='<a href="" class="selectZoneBtn">'.$zoneName.'<br />无角色</a>';
			}
		}
		return '
		<div class="popupbox " id="alertSelectZone" style="display:none;">
			<div class="warning">
				<div class="tip">
					<div class="tiptop tit_alert">
						<div class="tit_sfconf" >选区</div>
						<a href="javascript:DMZ.expand.shadeLayer.closed();" class="btn-close"></a></div>
						<div class="tipbox tipalert" id="alertContentZone">
							<table cellspacing="0" cellpadding="0" border="0">
								<tbody>
									<tr>
										<td>
											<div class="alertInfo" >
												<p class="p0t selectZoneP0t">'.$selectZone.'</p>
											</div>
										</td>
									</tr>
								</tbody>
							</table>
						
					</div>
				</div>
			</div>
		</div>';
	}	
	
}